
'use strict';
import React, {
  AppRegistry,
  Component,
  StyleSheet,
  ToastAndroid,
  Text,
  TouchableHighlight ,
  View,
  Navigator,
  BackAndroid
} from 'react-native';
import firstpage from './firstpage';





var demo = React.createClass ({

  

  navigatorRenderScene: function(route, navigator){
             
          
          if (route.index > 0) {
            navigator.pop();
          }
            let Component = route.component;
            return (<Component {...route.params} navigator={navigator} />)
          
  },
  render() {

    var text = 'hahahah';
    var defaultName = 'FirstPageComponent';
    var defaultComponent = firstpage;
    

    return (
     <Navigator
          initialRoute={{ name: defaultName, component: defaultComponent }}
          configureScene={(route) => {
            return Navigator.SceneConfigs.FadeAndroid;
          }}
          renderScene={this.navigatorRenderScene} />
   
    );
  }
});

AppRegistry.registerComponent('demo', () => demo);
